﻿using MvcApplication;
using MvcApplication.service;
using MvcEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication4MVC.Models;
using WebApplication4MVC.request;

namespace WebApplication4MVC.Controllers
{
    public class DatEnyController : Controller
    {
        // GET: DatEny
        public ActionResult Index()
        {
            return View();
        }
        DemoService userDemo = new DemoService();
        public ActionResult GetOrderGrp(OrderAmouteRequest request)
        {
            var resp = new OrdersEnyLineModel();
            //数据库拿数据
            var dblist = userDemo.listOrder();
              var list =  dblist.data as List<OrderInfoTest>;
            resp.Amount = list.Select(x => x.Amount).ToList();
            var listdate = from a in list
                           select new
                           {
                               orderstr = a.OrderDate.ToString("HH:mm")
                           };
            resp.OrderDate = listdate.Select(x => x.orderstr).ToList();


            //resp.OrderDate = 
            return Json(resp.CreateSuccess());
        }

    }
}